﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for ProContact
/// </summary>
public class ProContact
{
	public ProContact()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    //false : can't insert or insert error.
    //true: Insert successful
    public Boolean InsertContact(EnContact ct)
    {
        Boolean bResult = false;
        ConnectDB db = new ConnectDB();
        bResult = db.addContact(ct);
        return bResult;
    }
    //load all contact
    public DataSet LoadContact()
    {
        DataSet ds = new DataSet();
        ConnectDB db = new ConnectDB();
        ds = db.getContact();
        return ds;
    }
    //load contact is pending for replay
    public DataSet LoadContactPending()
    {
        DataSet ds = new DataSet();
        ConnectDB db = new ConnectDB();
        ds = db.getContactPending();
        return ds;
    }
    //delete contact
    public Boolean DeleteCont(EnContact cont)
    {
        ConnectDB db = new ConnectDB();
        Boolean bResult = db.deleteContact(cont);
        return bResult;
    }
    //load contact selected
    public DataSet LoadInfoCont(int id)
    {
        DataSet ds = new DataSet();
        ConnectDB db = new ConnectDB();
        ds = db.getInfoContact(id);
        return ds;
    }
    //change status when email reply has been sent
    public Boolean ChangeStatus(int id)
    {
        ConnectDB db = new ConnectDB();
        Boolean bResult = db.changeStatus(id);
        return bResult;
    }
}
